/**
 * Created by Administrator on 2019/6/18.
 */
var ttt = document.querySelector(".header nav");
var tt = document.querySelector(".header1");


var p = document.querySelector(".top");
window.onscroll = function () {
    if(document.documentElement.scrollTop > 300 || document.body.scrollTop > 300){
        ttt.style.display = "none";
        tt.style.display = "block";
    }else{
        ttt.style.display = "block";
        tt.style.display = "none";
    }
    if(document.documentElement.scrollTop > 1000 || document.body.scrollTop > 1000){
        p.style.display = "block";
    }else{
        p.style.display = "none";
    }
};


p.addEventListener('click',function () {
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});


var pp = document.querySelector("#top");
pp.addEventListener('click',function () {
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})


var xs_nav = document.querySelector(".xs-nav .box > img");
xs_nav.addEventListener('click',function () {
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
})




var ex_one = document.querySelector(".ex-one");
var one_ex = document.querySelector(".one-ex");
var ex_i = document.querySelector(".ex-one > i");
ex_one.addEventListener("click",function () {
    if(one_ex.style.height == "auto"){
        one_ex.style.height = "0";
        one_ex.style.opacity = "0";
        ex_i.style.transform = "rotate(0)";
        one_ex.style.display = "none";
    }else{
        one_ex.style.height = "auto";
        one_ex.style.opacity = "1";
        ex_i.style.transform = "rotate(45deg)";
        one_ex.style.display = "block";
    }
});


var ex_two = document.querySelector(".ex-two");
var two_ex = document.querySelector(".two-ex");
var ex_ii = document.querySelector(".ex-two > i");
ex_two.addEventListener("click",function () {
    if(two_ex.style.height == "auto"){
        two_ex.style.height = "0";
        two_ex.style.opacity = "0";
        ex_ii.style.transform = "rotate(0)";
        two_ex.style.display = "none";
    }else{
        two_ex.style.height = "auto";
        two_ex.style.opacity = "1";
        ex_ii.style.transform = "rotate(45deg)";
        two_ex.style.display = "block";
    }
});


var ex_three = document.querySelector(".ex-three");
var three_ex = document.querySelector(".three-ex");
var three_ii = document.querySelector(".ex-three > i");
ex_three.addEventListener("click",function () {
    if(three_ex.style.height == "auto"){
        three_ex.style.height = "0";
        three_ex.style.opacity = "0";
        three_ii.style.transform = "rotate(0)";
        three_ex.style.display ="none";
    }else{
        three_ex.style.height = "auto";
        three_ex.style.opacity = "1";
        three_ii.style.transform = "rotate(45deg)";
        three_ex.style.display = "block";
    }
});


var ex_four = document.querySelector(".ex-four");
var four_ex = document.querySelector(".four-ex");
var four_ii = document.querySelector(".ex-four > i");
ex_four.addEventListener("click",function () {
    if(four_ex.style.height == "auto"){
        four_ex.style.height = "0";
        four_ex.style.opacity = "0";
        four_ii.style.transform = "rotate(0)";
        four_ex.style.display = "none";
    }else{
        four_ex.style.height = "auto";
        four_ex.style.opacity = "1";
        four_ii.style.transform = "rotate(45deg)";
        four_ex.style.display = "block";
    }
});